var express = require('express');
var router = express.Router();
var DB = require('../config/DB');

// 进行数据库的查询
/* GET users listing. */
router.post('/', function (req, res, next) {
  // 验证登录是否成功
  if (false) return;
  // 登录成功设置session
  req.session.userName = req.body.username;
  // 登录成功跳转
  res.send({
    status: 200,
    msg: '恭喜' + req.session.userName + '登录成功',
    data: {}
  });
  // res.redirect('users');
});

module.exports = router;